﻿using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DbSharp.Framework.CaseFile;
using System.Reflection ;


namespace DbSharp.GuiRunner.ViewItems
{
    [Obfuscation]
    class DbConnectionViewItem : INotifyPropertyChanged
    {
        private string m_ConnectionName;
        private string m_Provider;
        private string m_ConnectionString;

        public DbConnectionViewItem(DbConnectionConfig config)
        {
            m_ConnectionName = config.ConnectionName;
            m_ConnectionString = config.ConnectionString;
            m_Provider = config.ProviderName;
        }


        public string ConnectionName
        {
            get { return m_ConnectionName; }
            set
            {
                m_ConnectionName = value;
                if (PropertyChanged != null)
                    PropertyChanged(this, new PropertyChangedEventArgs("ConnectionName"));
            }
        }

        public string Provider
        {
            get { return m_Provider; }
            set
            {
                m_Provider = value;
                if (PropertyChanged != null)
                    PropertyChanged(this, new PropertyChangedEventArgs("Provider"));
            }
        }

        public string ConnectionString
        {
            get { return m_ConnectionString; }
            set
            {
                m_ConnectionString = value;
                if (PropertyChanged != null)
                    PropertyChanged(this, new PropertyChangedEventArgs("ConnectionString"));
            }
        }

        //BindingList<DbConnectionListItem> list;

        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion
    }



     
}
